extends Timer

@export var enemy_Scene: PackedScene
@onready var spawn_timer: Timer = self


func _process(delta: float) -> void:
	spawn_timer.wait_time -= 0.2 * delta
	spawn_timer.wait_time = clamp(spawn_timer.wait_time, 1, 3)

func _on_timeout() -> void:
	var enemy_node = enemy_Scene.instantiate()
	enemy_node.position = Vector2(250, randf_range(30, 115))
	get_tree().current_scene.add_child(enemy_node)
